package com.xma.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: arthur
 * @License: (C) Copyright 2020-2028, xxx Corporation Limited.
 * @Contact: 413911174@qq.com
 * @Date: 2020/6/27 20:17
 * @Version: 1.0
 * @Description:
 */
@RestController
//修改完配置文件要更新 才能刷新配置
//curl -X POST "http://localhost:3355/actuator/refresh"
@RefreshScope
public class ConfigClinetController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/configInfo")
    public String getConfigInfo(){
        return "serverPort: " +  serverPort + "\t\n\n configInfo: " + configInfo;
    }
}
